#7-1 字符串拼接操作【字符串】
def str_sub():
    symbol = input()
    length = int(input())
    date = input()

    # 对日期进行格式化
    year, month, day = date.split('/')
    formatDate = f"{year}年{int(month):02d}月{int(day):02d}日"

    print(symbol * length)
    print(formatDate)
    print(symbol * length)
# str_sub()

# 7-2 月份缩写【字符串】
def abbr_mouths():
    months = "Jan.Feb.Mar.Apr.May.Jun.Jul.Aug.Sep.Oct.Nov.Dec."
    month_num = int(input())

    # 根据输入的月份数字找到对应的月份缩写
    abbr_month = months.split('.')[month_num - 1]

    print(abbr_month + ".")
# abbr_mouths()

#7-3 字符串加密【字符串】
def SecretStr():
    str1=input()
    result=''
    for char in str1:
        #遍历每个字符
        if char.isalpha():
            if char.isupper():
                new_char = chr((ord(char) - 65 + 5) % 26 + 65) if char.isupper() else chr((ord(char) - 97 + 3) % 26 + 97)
                result += new_char
            else:
                new_char = chr((ord(char) - 97 + 3) % 26 + 97) if char.islower() else char
                result += new_char
        else:
            result+=char
    print(result)
# SecretStr()
#7-4 念数字【字符串】
def readNum():
    digits_pinyin = ['ling', 'yi', 'er', 'san', 'si', 'wu', 'liu', 'qi', 'ba', 'jiu']
    num = input()

    if num[0] == '-':
        print('fu', end=' ')
        num = num[1:]

    for i in range(len(num)):
        if i < len(num) - 1:
            print(digits_pinyin[int(num[i])], end=' ')
        else:
            print(digits_pinyin[int(num[i])], end='')
    print()
# readNum()

#7-5 回文判断【字符串】
def huiwen():
    str = input()
    if str == str[::-1]:
        print("True")
    else:
        print("False")
# huiwen()
# 7-6 个人数据脱敏【字符串】
def data_desensitization():
    n = int(input())
    if n <= 0:
        print('ERROR')
    else:
        info = []
        for _ in range(n):
            stu_info = input().split()
            student_id = stu_info[0]
            name = stu_info[1]
            phone = stu_info[2]

            # 处理学号
            final_id = student_id[:4] + '*' * 7 + student_id[11:]

            # 处理姓名
            final_name = name[0] + '*' + name[2:]

            # 处理电话号码
            final_phone = phone[:3] + '*' * 4 + phone[7:]

            info.append([final_id, final_name, final_phone])

        print(info)
# data_desensitization()

# 7-7 判断火车票座位【字符串】
def tran():
    seat = input()

    if seat[:-1].isdigit() and seat[-1].isalpha():
        row = int(seat[:-1])
        position = seat[-1].upper()

        if row >= 1 and row <= 17:
            if position == 'A' or position == 'F':
                print('窗口')
            elif position == 'B':
                print('中间')
            elif position == 'C' or position == 'D':
                print('过道')
            else:
                print('输入错误')
        else:
            print('输入错误')
    else:
        print('输入错误')
tran()
# 7-8 各位数字之和为5的数【字符串】
def AllSum():
    def digit_sum(num):
        return sum(int(digit) for digit in str(num))

    n = int(input())
    result = [str(num) for num in range(n + 1) if digit_sum(num) == 5]
    print(" ".join(result))
# AllSum()

